import { FormCard } from '@/model/types/formCard';
import {
  FormTextBox,
  FormTextArea,
  FormDatetime,
  FormNumber,
  FormRadio,
  FormCheckbox,
  FormSelect,
  FormSwitch,
  FormAttachment,
  FormImage,
  FormAddress,
  FormMap,
  FormUser,
  FormMultiUser,
  FormDepartment,
  FormMultiDepartment,
  FormGroupTitle,
  FormLayout,
  FormDescription,
  FormSubGrid,
  FormTab,
  FormSeqNo,
  FormCreater,
  FormOwner,
  FormOwnerDept,
  FormCreateTime,
  FormUpdateTime,
  FormQuery,
  FormMultiQuery,
  FormAssociateProperty,
  FormFormula,
  FormButton,
  FormHandSign,
  FormOcr,
  FormEsign,
} from '@/model/designer/controlProperty';

export const FormCards: { [key: string]: FormCard } = {
  formTextBox: {
    cardCode: '',
    cardKey: 'formTextBox',
    controls: FormTextBox,
    cardType: 1,
    dataType: 128,
    dataTypeDesc: 'ShortString',
    cardName: '单行文本',
    icon: 'icon-luoshu-text-box',
    group: 'basic',
  },
  formTextArea: {
    cardCode: '',
    cardKey: 'formTextArea',
    controls: FormTextArea,
    cardType: 2,
    dataType: 124,
    dataTypeDesc: 'String',
    cardName: '多行文本',
    icon: 'icon-luoshu-text-area',
    group: 'basic',
  },
  formDatetime: {
    cardCode: '',
    cardKey: 'formDatetime',
    controls: FormDatetime,
    cardType: 3,
    dataType: 106,
    dataTypeDesc: 'Datetime',
    cardName: '日期',
    icon: 'icon-luoshu-datetime',
    group: 'basic',
  },
  formNumber: {
    cardCode: '',
    cardKey: 'formNumber',
    controls: FormNumber,
    cardType: 4,
    dataType: 116,
    dataTypeDesc: 'Int',
    cardName: '数字',
    icon: 'icon-luoshu-number',
    group: 'basic',
  },
  formRadio: {
    cardCode: '',
    cardKey: 'formRadio',
    controls: FormRadio,
    cardType: 5,
    dataType: 128,
    dataTypeDesc: 'ShortString',
    cardName: '单选框',
    icon: 'icon-luoshu-radio',
    group: 'basic',
    disabled: true,
  },
  formCheckbox: {
    cardCode: '',
    cardKey: 'formCheckbox',
    controls: FormCheckbox,
    cardType: 6,
    dataType: 126,
    dataTypeDesc: 'ShortStringArray',
    cardName: '复选框',
    icon: 'icon-luoshu-checkbox',
    group: 'basic',
    disabled: true,
  },
  formSelect: {
    cardCode: '',
    cardKey: 'formSelect',
    controls: FormSelect,
    cardType: 7,
    dataType: 126,
    dataTypeDesc: 'ShortStringArray',
    cardName: '下拉框',
    icon: 'icon-luoshu-select',
    group: 'basic',
    disabled: true,
  },
  formSwitch: {
    cardCode: '',
    cardKey: 'formSwitch',
    controls: FormSwitch,
    cardType: 8,
    dataType: 102,
    dataTypeDesc: 'Bool',
    cardName: '是/否',
    icon: 'icon-luoshu-switch',
    group: 'basic',
    disabled: true,
  },
  formAttachment: {
    cardCode: '',
    cardKey: 'formAttachment',
    controls: FormAttachment,
    cardType: 9,
    dataType: 202,
    dataTypeDesc: 'Attachment',
    cardName: '附件',
    icon: 'icon-luoshu-attachment',
    group: 'basic',
    disabled: true,
  },
  formImage: {
    cardCode: '',
    cardKey: 'formImage',
    controls: FormImage,
    cardType: 10,
    dataType: 204,
    dataTypeDesc: 'Image',
    cardName: '图片',
    icon: 'icon-luoshu-image',
    group: 'basic',
    disabled: true,
  },
  formAddress: {
    cardCode: '',
    cardKey: 'formAddress',
    controls: FormAddress,
    cardType: 11,
    dataType: 206,
    dataTypeDesc: 'Address',
    cardName: '地址',
    icon: 'icon-luoshu-address',
    group: 'basic',
    disabled: true,
  },
  formMap: {
    cardCode: '',
    cardKey: 'formMap',
    controls: FormMap,
    cardType: 12,
    dataType: 208,
    dataTypeDesc: 'Map',
    cardName: '位置',
    icon: 'icon-luoshu-map',
    group: 'basic',
    disabled: true,
  },
  formUser: {
    cardCode: '',
    cardKey: 'formUser',
    controls: FormUser,
    cardType: 13,
    dataType: 300,
    dataTypeDesc: 'SingleParticipant',
    cardName: '人员单选',
    icon: 'icon-luoshu-user',
    group: 'basic',
    disabled: true,
  },
  formMultiUser: {
    cardCode: '',
    cardKey: 'formMultiUser',
    controls: FormMultiUser,
    cardType: 14,
    dataType: 302,
    dataTypeDesc: 'MultiParticipant',
    cardName: '人员多选',
    icon: 'icon-luoshu-multi-user',
    group: 'basic',
    disabled: true,
  },
  formDepartment: {
    cardCode: '',
    cardKey: 'formDepartment',
    controls: FormDepartment,
    cardType: 15,
    dataType: 304,
    dataTypeDesc: 'SingleDepartment',
    cardName: '部门单选',
    icon: 'icon-luoshu-department',
    group: 'basic',
    disabled: true,
  },
  formMultiDepartment: {
    cardCode: '',
    cardKey: 'formMultiDepartment',
    controls: FormMultiDepartment,
    cardType: 16,
    dataType: 306,
    dataTypeDesc: 'MultiDepartment',
    cardName: '部门多选',
    icon: 'icon-luoshu-multi-department',
    group: 'basic',
    disabled: true,
  },
  formGroupTitle: {
    cardCode: '',
    cardKey: 'formGroupTitle',
    controls: FormGroupTitle,
    cardType: 101,
    dataType: 124,
    dataTypeDesc: 'String',
    cardName: '分组标题',
    icon: 'icon-luoshu-group-title',
    group: 'layout',
  },
  formLayout: {
    cardCode: '',
    cardKey: 'formLayout',
    controls: FormLayout,
    cardType: 102,
    dataType: 1,
    dataTypeDesc: 'Unspecified',
    cardName: '一行多列',
    icon: 'icon-luoshu-layout',
    group: 'layout',
    columns: [],
  },
  formDescription: {
    cardCode: '',
    cardKey: 'formDescription',
    controls: FormDescription,
    cardType: 103,
    dataType: 124,
    dataTypeDesc: 'String',
    cardName: '描述说明',
    icon: 'icon-luoshu-description',
    group: 'layout',
    disabled: true,
  },
  formSubGrid: {
    cardCode: '',
    cardKey: 'formSubGrid',
    controls: FormSubGrid,
    cardType: 104,
    dataType: 1,
    dataTypeDesc: 'Unspecified',
    cardName: '子表',
    icon: 'icon-luoshu-sub-grid',
    group: 'layout',
    disabled: true,
  },
  formTab: {
    cardCode: '',
    cardKey: 'formTab',
    controls: FormTab,
    cardType: 105,
    dataType: 1,
    dataTypeDesc: 'Unspecified',
    cardName: '标签页',
    icon: 'icon-luoshu-tab',
    group: 'layout',
    disabled: true,
  },
  formSeqNo: {
    cardCode: 'SeqNo',
    cardKey: 'formSeqNo',
    controls: FormSeqNo,
    cardType: 201,
    dataType: 128,
    dataTypeDesc: 'ShortString',
    cardName: '流水号',
    icon: 'icon-luoshu-seq-no',
    group: 'system',
    disabled: true,
  },
  formCreater: {
    cardCode: 'Creater',
    cardKey: 'formCreater',
    controls: FormCreater,
    cardType: 202,
    dataType: 300,
    dataTypeDesc: 'SingleParticipant',
    cardName: '创建人',
    icon: 'icon-luoshu-creater',
    group: 'system',
  },
  formOwner: {
    cardCode: 'Owner',
    cardKey: 'formOwner',
    controls: FormOwner,
    cardType: 203,
    dataType: 300,
    dataTypeDesc: 'SingleParticipant',
    cardName: '拥有者',
    icon: 'icon-luoshu-owner',
    group: 'system',
    disabled: true,
  },
  formOwnerDept: {
    cardCode: 'OwnerDept',
    cardKey: 'formOwnerDept',
    controls: FormOwnerDept,
    cardType: 204,
    dataType: 304,
    dataTypeDesc: 'SingleDepartment',
    cardName: '所属部门',
    icon: 'icon-luoshu-owner-dept',
    group: 'system',
    disabled: true,
  },
  formCreateTime: {
    cardCode: 'CreateTime',
    cardKey: 'formCreateTime',
    controls: FormCreateTime,
    cardType: 205,
    dataType: 106,
    dataTypeDesc: 'Datetime',
    cardName: '创建时间',
    icon: 'icon-luoshu-created-time',
    group: 'system',
  },
  formUpdateTime: {
    cardCode: 'UpdateTime',
    cardKey: 'formUpdateTime',
    controls: FormUpdateTime,
    cardType: 206,
    dataType: 106,
    dataTypeDesc: 'Datetime',
    cardName: '修改时间',
    icon: 'icon-luoshu-update-time',
    group: 'system',
  },
  formQuery: {
    cardCode: '',
    cardKey: 'formQuery',
    controls: FormQuery,
    cardType: 301,
    dataType: 500,
    dataTypeDesc: 'Aassociate',
    cardName: '关联表单',
    icon: 'icon-luoshu-form-query',
    group: 'advanced',
    disabled: true,
  },
  formMultiQuery: {
    cardCode: '',
    cardKey: 'formMultiQuery',
    controls: FormMultiQuery,
    cardType: 302,
    dataType: 502,
    dataTypeDesc: 'AassociateArray',
    cardName: '关联表单多选',
    icon: 'icon-luoshu-multi-department',
    group: 'advanced',
    disabled: true,
  },
  formAssociateProperty: {
    cardCode: '',
    cardKey: 'formAssociateProperty',
    controls: FormAssociateProperty,
    cardType: 303,
    dataType: 126,
    dataTypeDesc: 'ShortStringArray',
    cardName: '关联属性',
    icon: 'icon-luoshu-associate-property',
    group: 'advanced',
    disabled: true,
  },
  formFormula: {
    cardCode: '',
    cardKey: 'formFormula',
    controls: FormFormula,
    cardType: 304,
    dataType: 504,
    dataTypeDesc: 'Formula',
    cardName: '公式型卡片',
    icon: 'icon-luoshu-formula',
    group: 'advanced',
    disabled: true,
  },
  formButton: {
    cardCode: '',
    cardKey: 'formButton',
    controls: FormButton,
    cardType: 305,
    dataType: 128,
    dataTypeDesc: 'ShortString',
    cardName: '按钮',
    icon: 'icon-luoshu-btn',
    group: 'advanced',
    disabled: true,
  },
  formHandSign: {
    cardCode: '',
    cardKey: 'formHandSign',
    controls: FormHandSign,
    cardType: 307,
    dataType: 506,
    dataTypeDesc: 'Signature',
    cardName: '手写签名',
    icon: 'icon-luoshu-hand-sign',
    group: 'advanced',
    disabled: true,
  },
  formOcr: {
    cardCode: '',
    cardKey: 'formOcr',
    controls: FormOcr,
    cardType: 308,
    dataType: 508,
    dataTypeDesc: 'Ocr',
    cardName: '文字识别',
    icon: 'icon-luoshu-ocr',
    group: 'advanced',
    disabled: true,
  },
  formEsign: {
    cardCode: '',
    cardKey: 'formEsign',
    controls: FormEsign,
    cardType: 309,
    dataType: 510,
    dataTypeDesc: 'Esign',
    cardName: '电子签章',
    icon: 'icon-luoshu-esign',
    group: 'advanced',
    disabled: true,
  },
};
